package com.harry12.mybatis.Mapper;

import com.harry12.mybatis.entity.Payment;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

//@Mapper
//@Repository
public interface PaymentMapper {
    /**
     * 根据id查询payment
     * @param id
     * @return
     */
    @Select("select * from payment where id =#{id} ")
    public Payment getPaymentById(Integer id);

    /**
     * 根据id删除payment
     * @return
     */
    @Delete("delete from payment where id=#{id}")
    public int deletePaymentById();

    /**
     * 新增新的payment
     *
     * @param payment
     * @return
     */
    @Insert("insert into payment (id,serial) values(#{id},#{serial})")
    public int insertPayment(Payment payment);

    /**
     * 更新payment
     * @param payment
     * @return
     */
    @Update("update payment set id = #{serial} where id =#{id} ")
    public int updatePayment(Payment payment);
}
